import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

import {fetch, post} from './api/http.js'
Vue.prototype.$fetch = fetch
Vue.prototype.$post = post

// 引入全局样式
import '@/assets/css/global.css'
// import '@/assets/fonts/iconfont.css'
// 引入elementui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import moment from 'moment'
Vue.prototype.moment = moment;
// import 'xe-utils'
// import VXETable from 'vxe-table'
// import 'vxe-table/lib/style.css'
// Vue.use(VXETable)

// router.beforeEach((to, from, next) => {
//   nprogress.start()
//   if (store.state.token) {   //判断是否已经登录
//     next();
//   } else {
//     if(to.path === '/login')next()
//     next('/login');
//     nprogress.done()
//   }
// });
// router.afterEach((to, from) => {
//   nprogress.done()
// })
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
